// vite.config.js
import { defineConfig, loadEnv } from "file:///D:/job4/cdd-admin-web/ceres-admin-web/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/job4/cdd-admin-web/ceres-admin-web/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import AutoImport from "file:///D:/job4/cdd-admin-web/ceres-admin-web/node_modules/unplugin-auto-import/dist/vite.js";
import Components from "file:///D:/job4/cdd-admin-web/ceres-admin-web/node_modules/unplugin-vue-components/dist/vite.mjs";
import { ElementPlusResolver } from "file:///D:/job4/cdd-admin-web/ceres-admin-web/node_modules/unplugin-vue-components/dist/resolvers.mjs";
import { resolve } from "path";
import { createSvgIconsPlugin } from "file:///D:/job4/cdd-admin-web/ceres-admin-web/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import fs from "fs";
var __vite_injected_original_dirname = "D:\\job4\\cdd-admin-web\\ceres-admin-web";
var optimizeDepsElementPlusIncludes = ["element-plus/es"];
fs.readdirSync("node_modules/element-plus/es/components").forEach((dirname) => {
  fs.access(
    `node_modules/element-plus/es/components/${dirname}/style/css.mjs`,
    (err) => {
      if (!err) {
        optimizeDepsElementPlusIncludes.push(
          `element-plus/es/components/${dirname}/style/css`
        );
      }
    }
  );
});
var vite_config_default = defineConfig(({ command, mode }) => {
  const env = loadEnv(mode, process.cwd());
  console.log(mode, command, env);
  return {
    base: env.VITE_BASE_PREFIX,
    // root: resolve(__dirname, 'src'),
    // publicDir: resolve(__dirname, './public'),
    plugins: [
      vue(),
      AutoImport({
        resolvers: [ElementPlusResolver()]
      }),
      Components({
        resolvers: [ElementPlusResolver({
          importStyle: "sass"
        })]
      }),
      createSvgIconsPlugin({
        // 指定需要缓存的图标文件夹
        iconDirs: [resolve(process.cwd(), "src/assets/icon/svg")],
        // 指定symbolId格式
        symbolId: "icon-[name]"
      })
    ],
    resolve: {
      alias: {
        "@": resolve(__vite_injected_original_dirname, "src"),
        "@@": resolve(__vite_injected_original_dirname, "canvas")
      }
    },
    server: {
      proxy: {
        "/api": {
          // target: env.VITE_BASE_URL,
          target: "http://127.0.0.1:9003",
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, "")
        }
      }
    },
    define: {
      "process.env": {}
    },
    css: {
      preprocessorOptions: {
        // 全局样式引入
        scss: {
          additionalData: '@use "canvas/styles/index.scss" as *;',
          javascriptEnabled: true
        }
      }
    },
    // 构建配置项
    build: {
      chunkSizeWarningLimit: 1500,
      rollupOptions: {
        input: {
          index: resolve(__vite_injected_original_dirname, "index.html"),
          canvas: resolve(__vite_injected_original_dirname, "canvas.html")
        },
        output: {
          manualChunks(id) {
            if (id.includes("node_modules")) {
              return id.toString().split("node_modules/")[1].split("/")[0].toString();
            }
          }
        }
      }
    },
    optimizeDeps: {
      include: optimizeDepsElementPlusIncludes
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcuanMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFxqb2I0XFxcXGNkZC1hZG1pbi13ZWJcXFxcY2VyZXMtYWRtaW4td2ViXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJEOlxcXFxqb2I0XFxcXGNkZC1hZG1pbi13ZWJcXFxcY2VyZXMtYWRtaW4td2ViXFxcXHZpdGUuY29uZmlnLmpzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9EOi9qb2I0L2NkZC1hZG1pbi13ZWIvY2VyZXMtYWRtaW4td2ViL3ZpdGUuY29uZmlnLmpzXCI7aW1wb3J0IHsgZGVmaW5lQ29uZmlnLCBsb2FkRW52IH0gZnJvbSAndml0ZSc7XHJcbmltcG9ydCB2dWUgZnJvbSAnQHZpdGVqcy9wbHVna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1NUM0MFx1NjgzN1x1NUYwRlx1NUYxNVx1NTE2NVxyXG4gICAgICAgIHNjc3M6IHtcclxuICAgICAgICAgIGFkZGl0aW9uYWxEYXRhOiAnQHVzZSBcImNhbnZhcy9zdHlsZXMvaW5kZXguc2Nzc1wiIGFzICo7JyxcclxuICAgICAgICAgIGphdmFzY3JpcHRFbmFibGVkOiB0cnVlXHJcbiAgICAgICAgfVxyXG4gICAgICB9XHJcbiAgICB9LFxyXG4gICAgLy8gXHU2Nzg0XHU1RUZBXHU5MTREXHU3RjZFXHU5ODc5XHJcbiAgICBidWlsZDoge1xyXG4gICAgICBjaHVua1NpemVXYXJuaW5nTGltaXQ6IDE1MDAsXHJcbiAgICAgIHJvbGx1cE9wdGlvbnM6IHtcclxuICAgICAgICBpbnB1dDoge1xyXG4gICAgICAgICAgaW5kZXg6IHJlc29sdmUoX19kaXJuYW1lLCAnaW5kZXguaHRtbCcpLFxyXG4gICAgICAgICAgY2FudmFzOiByZXNvbHZlKF9fZGlybmFtZSwgJ2NhbnZhcy5odG1sJylcclxuICAgICAgICB9LFxyXG4gICAgICAgIG91dHB1dDoge1xyXG4gICAgICAgICAgbWFudWFsQ2h1bmtzIChpZCkge1xyXG4gICAgICAgICAgICBpZiAoaWQuaW5jbHVkZXMoJ25vZGVfbW9kdWxlcycpKSB7XHJcbiAgICAgICAgICAgICAgcmV0dXJuIGlkXHJcbiAgICAgICAgICAgICAgICAudG9TdHJpbmcoKVxyXG4gICAgICAgICAgICAgICAgLnNwbGl0KCdub2RlX21vZHVsZXMvJylbMV1cclxuICAgICAgICAgICAgICAgIC5zcGxpdCgnLycpWzBdXHJcbiAgICAgICAgICAgICAgICAudG9TdHJpbmcoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgICB9LFxyXG4gICAgfSxcclxuICAgIG9wdGltaXplRGVwczoge1xyXG4gICAgICBpbmNsdWRlOiBvcHRpbWl6ZURlcHNFbGVtZ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